package com.onlinelearn.userservice.repository;

import com.onlinelearn.userservice.model.UserRole;
import com.onlinelearn.userservice.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface RoleRepository extends JpaRepository<User, Long> {
    // 根据角色查询用户
    List<User> findByRole(UserRole role);

    // 检查用户是否有特定权限
    boolean existsByRoleAndPermissions(UserRole role, String permission);
} 